<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="static/bootstrap/css/bootstrap.min.css" />
<link rel="stylesheet" href="static/bootstrap/css/bootstrap-theme.min.css" />
<link rel="stylesheet" type="text/css" href="static/easyui/themes/bootstrap/easyui.css">
<link rel="stylesheet" type="text/css" href="static/easyui/themes/icon.css">
<link rel="stylesheet" href="static/css/style.css" />
<script src="static/jquery/jquery-1.12.4.js"></script>
<script src="static/easyui/jquery.easyui.min.js"></script>
<script src="static/easyui/locale/easyui-lang-zh_CN.js"></script>
<title>关联追溯</title>
<style type="text/css">
.div1 {
	margin: 10px auto;
	padding: 5px;
}
</style>
</head>
<body>
	<div class="title" style="margin-top: 10px;">
		<div class="content_container">
			<table class="content_table" align="center">
				<tr>
					<td style="width: 120px;">项目名：</td>
					<td>
						<input class="easyui-textbox" id="projectitemname" name="projectitemname" data-options="readonly:true" style="width: 200px;" />
					</td>
					<td style="width: 100px;">立项号：</td>
					<td>
						<input class="easyui-textbox" id="projectno" name="projectno" data-options="readonly:true" style="width: 200px;" />
					</td>
				</tr>
				<tr>
					<td style="width: 100px;">发布人：</td>
					<td>
						<input class="easyui-textbox" data-options="readonly:true" id="createrid" name="createrid" style="width: 200px;" />
					</td>
					<td style="width: 100px;">状态：</td>
					<td>
						<input class="easyui-textbox" data-options="readonly:true" id="status" name="status" style="width: 200px;" />
					</td>
				</tr>
				<tr>
					<td style="width: 100px;">项目负责人：</td>
					<td>
						<input class="easyui-textbox" data-options="readonly:true" id="role2" name="role2" style="width: 200px;" />
					</td>
					<td style="width: 100px;">现场负责人：</td>
					<td>
						<input class="easyui-textbox" data-options="readonly:true" id="role3" name="role3" style="width: 200px;" />
					</td>
				</tr>
				<tr>
					<td style="width: 100px;">预算成本（元）：</td>
					<td>
						<input class="easyui-textbox" id="companymoney" name="companymoney" data-options="readonly:true" style="width: 200px;" />
					</td>
				</tr>
				<tr>
					<td style="width: 100px;">建设方：</td>
					<td>
						<input class="easyui-textbox" id="role4" name="role4" data-options="readonly:true" style="width: 200px;" />
					</td>

					<td style="width: 100px;">建设方地址：</td>
					<td>
						<input class="easyui-textbox" id="clientaddr" name="clientaddr" data-options="readonly:true" style="width: 200px;" />
					</td>
				</tr>
				<tr>
					<td style="width: 100px;">电话号码：</td>
					<td>
						<input class="easyui-textbox" id="clienttel" name="clienttel" data-options="readonly:true" style="width: 200px;" />
					</td>
					<td style="width: 100px;">施工地址：</td>
					<td>
						<input class="easyui-textbox" id="projectaddr" name="projectaddr" data-options="readonly:true" style="width: 200px;" />
					</td>
				</tr>
				<tr>
					<td style="width: 100px;">工程概况：</td>
					<td colspan="3">
						<input class="easyui-textbox" id="summary" name="summary" data-options="readonly:true,multiline:true"
							style="width: 505px; height: 80px;" />
					</td>
				</tr>
				<tr>
					<td style="width: 100px;">开始日期：</td>
					<td>
						<input class="easyui-textbox" id="startdate" name="startdate" data-options="readonly:true" style="width: 200px;" />
					</td>
					<td style="width: 100px;">结束日期：</td>
					<td>
						<input class="easyui-textbox" id="enddate" name="enddate" data-options="readonly:true" style="width: 200px;" />
					</td>
				</tr>
			</table>
		</div>
	</div>
	<div class="div1 container text-center" style="width: 500px;">
		<div class="row">
			<div class="col-sm-4 col-md-4 col-lg-4 col-xs-4 ">
				<button style="width: 100px; margin: 5px;" class="d-btn btn-blue" onclick="toplanmain()" value="">主计划</button>
			</div>
			<div class="col-sm-4 col-md-4 col-lg-4 col-xs-4 ">
				<button style="width: 100px; margin: 5px;" class="d-btn btn-blue" onclick="toschedule()" value="">工程进度</button>
			</div>
			<div class="col-sm-4 col-md-4 col-lg-4 col-xs-4 ">
				<button style="width: 100px; margin: 5px;" class="d-btn btn-blue" onclick="tobudgetmain()" value="">主预算</button>
			</div>
			<div class="col-sm-4 col-md-4 col-lg-4 col-xs-4 ">
				<button style="width: 100px; margin: 5px;" class="d-btn btn-blue" onclick="tomoneyinfo()" value="">资金</button>
			</div>
			<div class="col-sm-4 col-md-4 col-lg-4 col-xs-4 ">
				<button style="width: 100px; margin: 5px;" class="d-btn btn-blue" onclick="toattendance()" value="">考勤</button>
			</div>
			<div class="col-sm-4 col-md-4 col-lg-4 col-xs-4 ">
				<button style="width: 100px; margin: 5px;" class="d-btn btn-blue" onclick="tosafetyinspection()" value="">安全巡检</button>
			</div>
			<div class="col-sm-4 col-md-4 col-lg-4 col-xs-4 ">
				<button style="width: 100px; margin: 5px;" class="d-btn btn-blue" onclick="toreport()" value="">施工日志</button>
			</div>
			<div class="col-sm-4 col-md-4 col-lg-4 col-xs-4 ">
				<button style="width: 100px; margin: 5px;" class="d-btn btn-blue" onclick="tourgentapply()" value="">工程联系单</button>
			</div>
			<div class="col-sm-4 col-md-4 col-lg-4 col-xs-4 ">
				<button style="width: 100px; margin: 5px;" class="d-btn btn-blue" onclick="tocapitalapply()" value="">资金申请</button>
			</div>
			<!-- <div class="col-sm-4 col-md-4 col-lg-4 col-xs-4 ">
				<button style="width: 100px; margin: 5px;" class="d-btn btn-blue" onclick="towarningtips()" value="">预警提示</button>
			</div> -->
			<div class="col-sm-4 col-md-4 col-lg-4 col-xs-4 ">
				<button style="width: 100px; margin: 5px;" class="d-btn btn-blue" onclick="tofinishapply()" value="">竣工材料</button>
			</div>
		</div>
	</div>
</body>

<script th:inline="javascript">
	var currentPro;
	var projectitem = [[${projectitem}]];
		$.ajax({
			type : 'GET',
			url : "encryptMoney.do",
			data : {compactmoney:projectitem.compactmoney,projectitemid:projectitem.id},
			contentType : "application/json",
			success : function(data) {
				$("#compactmoney").textbox('setValue',data);
			},
			dataType : "json"
		});
	$(document).ready(function() {
		if (projectitem) {
			$("#projectitemname").textbox('setValue',projectitem.name);
			$("#projectno").textbox('setValue',projectitem.projectno);
			$("#createrid").textbox('setValue',projectitem.creater.name);
			$("#summary").textbox('setValue',projectitem.summary);
			$("#companymoney").textbox('setValue',projectitem.companymoney);
			$("#status").textbox('setValue',projectitem.status);
			$("#startdate").textbox('setValue',formatDate(projectitem.startdate));
			$("#enddate").textbox('setValue',formatDate(projectitem.enddate));
			$("#clientaddr").textbox('setValue',projectitem.clientaddr);
			$("#clienttel").textbox('setValue',projectitem.clienttel);
			$("#projectaddr").textbox('setValue',projectitem.projectaddr);
			var names2 = "";
			var names3 = "";
			var names4 = "";
			$.each(projectitem.level2,function(i,val){
				names2+=val.name+" ";
			});
			$.each(projectitem.level3,function(i,val){
				names3+=val.name+" ";
			});
			$.each(projectitem.level4,function(i,val){
				names4+=val.name+" ";
			});
			$("#role2").textbox('setValue',names2);
			$("#role3").textbox('setValue',names3);
			$("#role4").textbox('setValue',names4);
			if(projectitem.status==1){
				$("#status").textbox('setValue','待确认');
			}else if(projectitem.status==2){
				$("#status").textbox('setValue','进行中');
			}else if(projectitem.status==5){
				$("#status").textbox('setValue','已竣工');
			}
		}
	});
	
	function formatDate(time) {
		var date = new Date(time);
		var year = date.getFullYear(), month = date.getMonth() + 1, //月份是从0开始的
		day = date.getDate(), hour = date.getHours(), min = date.getMinutes(), sec = date
				.getSeconds();
		var newTime = year + '年' + month + '月' + day + '日';
		return newTime;
	}

	function toplanmain() {
		var title = '主计划-'+projectitem.name;
		window.parent.window.addTab(title,"toplanmain.do?projectitemid="+projectitem.id,projectitem.id);
		//window.parent.window.addTab(title,"toplanmain.do?projectitemid="+projectitem.id,projectitem.id);
	}
	
	function tobudgetmain() {
		var title = '主预算-'+projectitem.name;
		window.parent.window.addTab(title,"tobudgetmain.do?projectitemid="+projectitem.id,projectitem.id);
	}
	
	function toattendance() {
		var title = '考勤-'+projectitem.name;
		window.parent.window.addTab(title,"toattendance.do?projectitemid="+projectitem.id,projectitem.id);
	}
	
	function tosafetyinspection() {
		var title = '安全巡检-'+projectitem.name;
		window.parent.window.addTab(title,"tosafetyinspection.do?projectitemid="+projectitem.id,projectitem.id);
	}
	
	function toreport() {
		var title = '施工日志-'+projectitem.name;
		window.parent.window.addTab(title,"toreport.do?projectitemid="+projectitem.id,projectitem.id);
	}
	
	function tourgentapply() {
		var title = '工程联系单-'+projectitem.name;
		window.parent.window.addTab(title,"tourgentapply.do?projectitemid="+projectitem.id,projectitem.id);
	}
	
	function tocapitalapply() {
		var title = '资金申请-'+projectitem.name;
		window.parent.window.addTab(title,"tocapitalapply.do?projectitemid="+projectitem.id,projectitem.id);
	}
	
	function towarningtips() {
		var title = '预警提示-'+projectitem.name;
		window.parent.window.addTab(title,"towarningtips.do?projectitemid="+projectitem.id,projectitem.id);
	}
	
	function tofinishapply() {
		var title = '竣工材料-'+projectitem.name;
		window.parent.window.addTab(title,"tofinishapply.do?projectitemid="+projectitem.id,projectitem.id);
	}
	function tomoneyinfo(){
		var title = '资金-'+projectitem.name;
		window.parent.window.addTab(title,"tomoneyinfo.do?projectitemid="+projectitem.id,projectitem.id);
	}
	
	function toschedule() {
		var title = '工程进度-'+projectitem.name;
		window.parent.window.addTab(title,"toschedule.do?projectitemid="+projectitem.id,projectitem.id);
	}
	function totable() {
		var title = '汇总表-'+projectitem.name;
		window.parent.window.addTab(title,"totable.do?projectitemid="+projectitem.id,projectitem.id);
	}
</script>
<style>
.content_table td {
	padding: 6px;
	border-bottom:1px solid #eee;
}
.textbox{border:0;}
</style>
</html>